﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using BeetleX.Http.Clients;
using DEEBCG.ExternalLib.CompanyAPI.Model;

namespace DEEBCG.ExternalLib.CompanyAPI
{
    /// <summary>
    /// 获取Company接口类
    /// </summary>
    [Controller(BaseUrl = "/api/Company/")]
    public interface ICompany
    {
        /// <summary>
        /// 获取指定机构信息
        /// </summary>
        /// <param name="id">机构编号</param>
        /// <returns></returns>
        [Get]
        Task<ResultInfo<CompanyInfo>> Get(string id, [Header("DEEBCG")] string token);

        /// <summary>
        /// 获取本机机构和子级机构列表
        /// </summary>
        /// <returns></returns>
        [Get]
        Task<ResultInfo<IList<CompanyInfo>>> GetList([Header("DEEBCG")]string token);

        /// <summary>
        /// 更新机构信息
        /// </summary>
        /// <param name="info">机构信息</param>
        /// <returns></returns>
        [Put]
        Task<ResultInfo<string>> Update(CompanyInfo info, [Header("DEEBCG")] string token);


        /// <summary>
        /// 添加子机构
        /// </summary>
        /// <param name="info">机构信息</param>
        /// <returns></returns>
        [Post]
        Task<ResultInfo<string>> Add(CompanyInfo info, [Header("DEEBCG")] string token);


        /// <summary>
        /// 删除子级机构
        /// </summary>
        /// <param name="id">子级机构ID</param>
        /// <returns></returns>
        [Del]
        Task<ResultInfo<string>> DeleteChildCompany(string id, [Header("DEEBCG")] string token);


        /// <summary>
        /// 获取位置信息列表
        /// </summary>
        /// <param name="id">企业编号</param>
        /// <returns></returns>
        [Get]
        Task<ResultInfo<IList<LocationInfo>>> GetLocations(string id, [Header("DEEBCG")] string token);

        /// <summary>
        /// 删除位置详细信息
        /// </summary>
        /// <returns></returns>
        [Del]
        Task<ResultInfo<string>> DeleteLocation(int id, [Header("DEEBCG")] string token);


        /// <summary>
        /// 添加位置
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [Post]
        Task<ResultInfo<int>> AddLocation(LocationInfo info, [Header("DEEBCG")] string token);

        /// <summary>
        /// 更新位置信息
        /// </summary>
        /// <param name="info">位置信息</param>
        /// <returns></returns>
        [Put]
        Task<ResultInfo<string>> UpdateLocation(LocationInfo info, [Header("DEEBCG")] string token);

    }
}
